package com.jly.service.impl;

import com.jly.anno.LogMonitor;
import com.jly.service.AirPlaneService;
import com.jly.vos.ApiResult;
import com.jly.vos.GuidanceDataVo;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.stereotype.Service;

/**
 * @author Liwenhao
 * @date 2022/3/23 15:52
 * @description 飞机业务类
 */
@Service("airPlaneServiceRPCImpl")
@ConditionalOnExpression("'${dev.request}'.equals('rpc')")
public class AirPlaneServiceRPCImpl implements AirPlaneService {

    @Override
    public ApiResult tackOffAirplane(Long id) {
        return ApiResult.success("飞机起飞");
    }

    @Override
    public ApiResult landAirplane(Long id) {
        return ApiResult.success("飞机着落");
    }

    @Override
    public ApiResult changeAirplaneSpeed(Long id, Double speed) {
        return ApiResult.success("飞机变速");
    }

    @Override
    public ApiResult attack(GuidanceDataVo request) {
        return ApiResult.success("攻击");
    }

    @Override
    @LogMonitor
    public ApiResult survey(Long id) {
        return ApiResult.success("飞机探测");
    }

    @Override
    public ApiResult surveyv2(Long id) {
        return null;
    }
}
